import request from '@/utils/request'

// 添加角色
export const addRoles = (data) => request.post('/sys/role', data)

// 获取所有角色列表
export const getRoles = (params) => request.get('/sys/role', { params })

// 根据ID更新角色
export const updateRoles = (data) => request.put(`/sys/role/${data.id}`, data)

// 根据ID删除角色
export const delRoles = (id) => request.delete(`/sys/role/${id}`)

// 根据ID获取角色详情
export const getRolesId = (id) => request.get(`/sys/role/${id}`)

// 给角色分配权限
export const assignPrem = (data) => request.put('/sys/role/assignPrem', data)

